package com.cskaoyan.market.service;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import java.util.HashMap;

@Service
public class FlashMapFactory {

    private final HashMap<String, Object> sharedHashMap;


    @Autowired
    public FlashMapFactory(HashMap<String, Object> sharedMap) {
        this.sharedHashMap = sharedMap;
    }

    public void putValue(String key, Object value) {
        sharedHashMap.put(key, value);
    }

    public Object getValue(String key) {
        return sharedHashMap.get(key);
    }

    @PostConstruct
    public void init() {
       putValue("flashOrderList",null);
       putValue("orderListIsFlash",true);
       putValue("flashFootprintsList",null);
       putValue("footprintsIsFlash",true);
    }
}
